// order/index/car_list
// 
var fromCity = 'SH';
var toCity = 'SH';
var fromSite = '1';
var toSite = '1';
function selectTime(obj){
	var pickUpTime = $('.calendar:first').asDatepicker('getDate','yyyy-mm-dd');
	var returnTime = $('.calendar:last').asDatepicker('getDate','yyyy-mm-dd');
	var pickUpTime_h = $('#pTime_Hour').find('option:selected').val();
	var returnTime_h = $('#rTime_Hour').find('option:selected').val();
	console.log(pickUpTime_h);
	console.log($('.pickUpTime'));
	$('#pTime').val(pickUpTime);
	$('#rTime').val(returnTime);
	$('#pTime_h').val(pickUpTime_h);
	$('#rTime_h').val(returnTime_h);

	// site
	$('#fc').val(fromCity);
	$('#tc').val(toCity);
	$('#fta').val(fromSite);
	$('#tca').val(toSite);
	$('#firstOrderInfo').submit();
}

// 下拉菜单函数
function getFromCity(obj){
	$obj = $(obj);
	console.log($obj.parent().find('select'));
	var city = $obj.find('option:selected').val();
	if (city=='BJ') {
		fromCity = city;
		fromSite = '3';
		$obj.parent().find('select').each(function(){
			$(this).css({'display':'none'});
			$(this).removeAttr('name');
		});

		$obj.css({'display':'block'});
		$obj.parent().children('#fromStoreName_BJ').css({'display':'block'});

	}else if(city=='SH'){
		fromCity = city;
		fromSite = '1';
		$obj.parent().find('select').each(function(){
			$(this).css({'display':'none'});
			$(this).removeAttr('name');
		});

		$obj.css('display','block');
		$obj.parent().children('#fromStoreName_SH').css({'display':'block'});
	}
}
// 下拉菜单函数
function getReturnCity(obj){
	$obj = $(obj);
	var city = $obj.find('option:selected').val();
	if (city=='BJ') {
		toCity = city;
		toSite = '3';
		$obj.parent().find('select').each(function(){$(this).css('display','none');});
		$obj.css('display','block');
		$obj.parent().children('#toStoreName_BJ').css('display','block');
	}else if(city == 'SH'){
		toSite = '1';
		toCity = city;
		$obj.parent().find('select').each(function(){$(this).css('display','none');});
		$obj.css('display','block');
		$obj.parent().children('#toStoreName_SH').css('display','block');
	}
}
$(document).ready(function(){

});

function getFromSite(obj){
	$obj = $(obj);
	fromSite = $obj.find('option:selected').val();
}
function getToSite(obj){
	$obj = $(obj);
	toSite = $obj.find('option:selected').val();
}	




